home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / compression / cl_cosmo.z / cl_cosmo
Encoding:
Text File  |  2002-10-03  |  15.3 KB  |  331 lines

  1.  
  2.  
  3.  
  4. ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))                                                    ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cl_cosmo - Cosmo Compress JPEG Accelerator (in the Compression Library)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccllll....hhhh>>>>
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      Cosmo Compress is an optional hardware accelerator for JPEG image
  16.      compression.  The programming interface to Cosmo is via the standard
  17.      Compression Library.  For overviews of the JPEG standard and the CL API,
  18.      see _j_p_e_g(4) and _C_L_i_n_t_r_o(3dm).
  19.  
  20.      Cosmo Compress implements a subset of the JPEG standard optimized for
  21.      video originated images.  This subset is baseline JPEG, interleaved
  22.      YCrCb, 8-bits per component.  Cosmo Compress is capable of compressing
  23.      and decompressing to and from memory, or to and from a special video
  24.      connection to IndyVideo, Galileo Video, or Indigo2 Video.
  25.  
  26.      Cosmo also supports an arbitrary scale down and clip of images being
  27.      decompressed.  This scaling happens without any performance penalty and
  28.      produces high quality results.
  29.  
  30.  
  31. PPPPRRRROOOOGGGGRRRRAAAAMMMMMMMMIIIINNNNGGGG CCCCOOOOSSSSMMMMOOOO CCCCOOOOMMMMPPPPRRRREEEESSSSSSSS
  32.      Cosmo Compress is programmed via the Compression Library (CL) utilizing
  33.      the base CL API as well as JPEG-specific and Cosmo-specific parameters.
  34.  
  35.  
  36.    UUUUSSSSIIIINNNNGGGG CCCCOOOOSSSSMMMMOOOO
  37.      The Cosmo Compress JPEG Codec is invoked by specifying CL_JPEG_COSMO as
  38.      the scheme argument to ccccllllOOOOppppeeeennnnCCCCoooommmmpppprrrreeeessssssssoooorrrr....  Only one application can have
  39.      Cosmo open at a time.  An error will be returned to the program if
  40.      another application has Cosmo open.
  41.  
  42.  
  43.    SSSSEEEETTTTTTTTIIIINNNNGGGG UUUUPPPP TTTTRRRRAAAANNNNSSSSFFFFEEEERRRRSSSS
  44.      Cosmo is capable of four different modes of operation.  External video
  45.      can be compressed to a memory buffer, a memory buffer can be decompressed
  46.      and sent out to external video, an image in memory can be compressed to
  47.      memory, and a compressed image can be decompressed to memory.  Video data
  48.      is always treated as non-interleaved fields.
  49.  
  50.      Memory to memory transfers may be initiated using the standard CL calls.
  51.      The size of the uncompressed image must not be larger than a PAL video
  52.      field (768x288).  The uncompressed data format must be CL_FORMAT_XBGR.
  53.  
  54.      Transfers to and from external video should use the CL direct buffered
  55.      interface specifying CL_EXTERNAL_DEVICE as the _f_r_a_m_e_B_u_f_f_e_r parameter to
  56.      ccccllllCCCCoooommmmpppprrrreeeessssssss or ccccllllDDDDeeeeccccoooommmmpppprrrreeeessssssss.  Additionally, the call to ccccllllDDDDeeeeccccoooommmmpppprrrreeeessssssss or
  57.      ccccllllCCCCoooommmmpppprrrreeeessssssss should either be made by a separate thread within the program
  58.      or with CL_CONTINUOUS_NONBLOCK as the frame count parameter since it will
  59.      not return until the transfer is complete.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))                                                    ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: GGGGEEEENNNNEEEERRRRAAAALLLL CCCCLLLL
  75.      The following general CL parameters are useful for Cosmo. For more
  76.      information, see _C_L_i_n_t_r_o(3dm).
  77.  
  78.      CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____WWWWIIIIDDDDTTTTHHHH
  79.           Uncompressed image width, in pixels.  When transfering to or from
  80.           external video using NTSC timing, the width must be 640.  When
  81.           transfering to or from external video using PAL timing, the width
  82.           must be 768.  The maximum width in memory to memory transfers is
  83.           768.  The width must always be a multiple of 16.  With IndyVideo601
  84.           option or Galileo on Indigo2, both CCIR 525 and CCIR 625 sizes are
  85.           supported.
  86.  
  87.      CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____HHHHEEEEIIIIGGGGHHHHTTTT
  88.           Uncompressed image height in pixels.  Since Cosmo deals in fields
  89.           which represent every other line of a video frame, the image height
  90.           is half of the full frame height.  The height must always be a
  91.           multiple of 8.  The external video port on Cosmo transmits 243 lines
  92.           per field in NTSC mode which is not a multiple of 8.  Applications
  93.           should therefore either specify 240 or 248 as the height for NTSC.
  94.           The height for PAL should be 288.  With IndyVideo601 option or
  95.           Galileo on Indigo2, both CCIR 525 and CCIR 625 sizes are supported.
  96.  
  97.      CCCCLLLL____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____IIIIMMMMAAAAGGGGEEEE____WWWWIIIIDDDDTTTTHHHH
  98.           Width of compressed image.  This is normally the same as
  99.           CL_IMAGE_WIDTH, but may be different when scaling is used.  Cosmo
  100.           has two types of image scaling capability.  When decompressing from
  101.           memory to memory, the image may be downsized from the original.
  102.           This mode of scaling is enabled by setting CL_IMAGE_WIDTH to the
  103.           desired reduced size while setting CL_INTERNAL_IMAGE_WIDTH to the
  104.           original size contained in the JPEG data.  When compressing or
  105.           decompressing from external video, Cosmo supports a limited form of
  106.           scaling.  If the CL_IMAGE_WIDTH is set to the width of the video
  107.           field (either 640 or 768), and CL_INTERNAL_IMAGE_WIDTH is set to one
  108.           half of that (either 320 or 384), then Cosmo will scale the image by
  109.           a factor of two.  It is only necessary to set this parameter if one
  110.           of these two types of scaling is desired.
  111.  
  112.      CCCCLLLL____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____IIIIMMMMAAAAGGGGEEEE____HHHHEEEEIIIIGGGGHHHHTTTT
  113.           Height of compressed image.  This is normally the same as
  114.           CL_IMAGE_HEIGHT, but may be different when scaling is used.  See the
  115.           discussion of CL_INTERNAL_IMAGE_WIDTH above.
  116.  
  117.      CCCCLLLL____FFFFOOOORRRRMMMMAAAATTTT
  118.           When decompressing or compressing to or from memory, Cosmo only
  119.           recognizes 32-bit RGB pixels which are called CL_FORMAT_XBGR by the
  120.           CL.
  121.  
  122.      CCCCLLLL____AAAALLLLGGGGOOOORRRRIIIITTTTHHHHMMMM____IIIIDDDD
  123.           The algorithm identifier for Cosmo is CL_JPEG_COSMO.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))                                                    ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.      CCCCLLLL____OOOORRRRIIIIEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  141.           Cosmo treats images as ``top down'' and has no support for flipping
  142.           images.
  143.  
  144.      CCCCLLLL____EEEENNNNAAAABBBBLLLLEEEE____IIIIMMMMAAAAGGGGEEEEIIIINNNNFFFFOOOO
  145.           Setting this parameter to ``TRUE'' enables the
  146.           ccccllllGGGGeeeettttNNNNeeeexxxxttttIIIImmmmaaaaggggeeeeIIIInnnnffffoooo(3dm) CL function which can be used to retrieve
  147.           time stamp and other information about compressed fields. In the
  148.           case of Cosmo compressing from external video, the time stamp
  149.           returned represents the time at which the first line of the
  150.           uncompressed field arrived at the Cosmo board.
  151.  
  152.  
  153.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: JJJJPPPPEEEEGGGG
  154.      The following JPEG parameters may also be used.  See _c_l__j_p_e_g(3dm) for
  155.      descriptions.
  156.  
  157.      CCCCLLLL____JJJJPPPPEEEEGGGG____QQQQUUUUAAAALLLLIIIITTTTYYYY____FFFFAAAACCCCTTTTOOOORRRR
  158.  
  159.      CCCCLLLL____JJJJPPPPEEEEGGGG____QQQQUUUUAAAANNNNTTTTIIIIZZZZAAAATTTTIIIIOOOONNNN____TTTTAAAABBBBLLLLEEEESSSS
  160.  
  161.      CCCCLLLL____JJJJPPPPEEEEGGGG____SSSSTTTTRRRREEEEAAAAMMMM____HHHHEEEEAAAADDDDEEEERRRRSSSS
  162.  
  163.  
  164.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: CCCCOOOOSSSSMMMMOOOO
  165.      These parameters are specific to Cosmo.
  166.  
  167.      CCCCLLLL____CCCCOOOOSSSSMMMMOOOO____VVVVIIIIDDDDEEEEOOOO____TTTTRRRRAAAANNNNSSSSFFFFEEEERRRR____MMMMOOOODDDDEEEE
  168.           Type: CL_ENUM_VALUE
  169.           When transfering to or from external video, the video
  170.           may be played continuously or single stepped a field or frame
  171.           at a time.  Cosmo has three different transfer modes.
  172.           CL_COSMO_VIDEO_TRANSFER_AUTO_1_FIELD, and
  173.           CL_COSMO_VIDEO_TRANSFER_AUTO_2_FIELD put the board in continuous
  174.           mode. CL_COSMO_VIDEO_TRANSFER_MANUAL puts the board in single step
  175.           mode.  In any mode, the frame output is either composed of (every)
  176.           single field replicated twice, or two different fields.
  177.  
  178.      CCCCLLLL____CCCCOOOOSSSSMMMMOOOO____VVVVIIIIDDDDEEEEOOOO____MMMMAAAANNNNUUUUAAAALLLL____CCCCOOOONNNNTTTTRRRROOOOLLLL
  179.           Type: CL_ENUM_VALUE
  180.           When the video transfer mode is set to manual, the output is
  181.           advanced one step by setting this parameter to
  182.           CL_COSMO_VIDEO_MANUAL_ADVANCE.  In order for the frame to actually
  183.           advance, there must be a decompressed frame in Cosmo's output queue.
  184.  
  185.      CCCCLLLL____CCCCOOOOSSSSMMMMOOOO____CCCCOOOODDDDEEEECCCC____CCCCOOOONNNNTTTTRRRROOOOLLLL
  186.           Type: CL_ENUM_VALUE
  187.           Setting to CL_COSMO_STOP will cause compression or decompression
  188.           to halt.  If clCompress or clDecompress had been called with
  189.           CL_CONTINUOUS_BLOCK, it will now return.  If clCompress
  190.           or clDecompress had been called with CL_CONTINUOUS_NONBLOCK,
  191.           the associated thread will terminate.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))                                                    ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))
  203.  
  204.  
  205.  
  206.      CCCCLLLL____CCCCOOOOSSSSMMMMOOOO____VVVVIIIIDDDDEEEEOOOO____IIIINNNNPPPPUUUUTTTT____CCCCOOOONNNNTTTTRRRROOOOLLLL
  207.           This is used to control how the external video device sends
  208.           timing information to Cosmo.  It is only needed when using Cosmo
  209.           with the IndyVideo/Galileo 601 Option.  It may be set to either
  210.           CL_COSMO_VIDEO_INPUT_PORT0, or CL_COSMO_VIDEO_INPUT_PORT1.
  211.  
  212.  
  213.    CCCCOOOONNNNNNNNEEEECCCCTTTTIIIINNNNGGGG TTTTOOOO VVVVIIIIDDDDEEEEOOOO
  214.      When using external video with Cosmo, special attention needs to be given
  215.      to the video synchronization setting of the video device.  When
  216.      capturing, the video synchronization should be set to ``slave''.  When
  217.      playing back, it should be set to either ``internal'' or ``genlock''.
  218.      Cosmo interfaces with the external video via two vl nodes, one for
  219.      sending video from Cosmo to the video board, and one for sending video
  220.      and timing information from the video board to Cosmo.  When playing back
  221.      to external video, both nodes have to be used, one providing video timing
  222.      to Cosmo, the other connecting Cosmo output to the video device.  Video
  223.      from IndyVideo/Galileo is sent on port 2 and video from Cosmo to
  224.      IndyVideo/Galileo is sent back on port 1.
  225.  
  226.      The following will set play back from Cosmo, into a window with
  227.      simultaneous video output.
  228.  
  229.           /*
  230.            * Assume svr is the server from vlOpenVideo(3),
  231.            * and dev is device number for the ``ev1'' device
  232.            * obtained via vlGetDeviceList(3).
  233.            */
  234.  
  235.           /*
  236.            * First, make sure the timing is set to internal
  237.            * or genlock
  238.            */
  239.           devNode = vlGetNode( svr, VL_DEVICE, VL_ANY );
  240.  
  241.           path = vlCreatePath( svr, dev, devNode, devNode );
  242.           vlSetupPaths( svr, &path, 1, VL_SHARE, VL_READ_ONLY );
  243.           vlGetControl( svr, path, devNode, VL_SYNC, &val );
  244.           if (val.intVal == VL_SYNC_SLAVE) {
  245.                val.intVal = VL_SYNC_INTERNAL;
  246.                vlSetControl( svr, path, devNode, VL_SYNC, &val );
  247.           }
  248.           vlDestroyPath(svr, path);
  249.  
  250.           /*
  251.            * Now set up the video transfer paths
  252.            */
  253.           cosmosrc  = vlGetNode( svr, VL_SRC, VL_VIDEO, 1 );
  254.           cosmodrn  = vlGetNode( svr, VL_DRN, VL_VIDEO, 2 );
  255.           videodrn  = vlGetNode( svr, VL_DRN, VL_VIDEO, 0 );
  256.           windowdrn = vlGetNode( svr, VL_DRN, VL_SCREEN, VL_ANY );
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))                                                    ccccllll____ccccoooossssmmmmoooo((((3333ddddmmmm))))
  269.  
  270.  
  271.  
  272.          path = vlCreatePath( svr, dev, cosmosrc, windowdrn );
  273.           vlAddNode( svr, path, videodrn );
  274.           vlAddNode( svr, path, cosmodrn );
  275.           vlSetupPaths( svr, &path, 1, VL_SHARE, VL_SHARE );
  276.  
  277.           /*
  278.            * Set window for windowdrn
  279.            */
  280.           val.intVal = windowId;
  281.           vlSetControl( svr, path, windowdrn, VL_WINDOW, &val );
  282.           vlBeginTransfer( svr, path, 0, NULL );
  283.  
  284.  
  285.      See _g_a_l_i_l_e_o(7) and _v_l(3dm) for more information.
  286.  
  287. FFFFIIIILLLLEEEESSSS
  288.      /usr/include/dmedia/cl.h
  289.  
  290.  
  291. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  292.      jpeg(4), CLintro(3dm), cl_jpeg(3dm),
  293.      vl(3dm), galileo(7)
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.